package com.example.stusystem.Dao;

import com.example.stusystem.pojo.Manager;
import com.example.stusystem.pojo.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface StudentMapper {
    @Select("select * from student")
    List<Student> selectAllDao();

    @Insert("insert into student values(null,#{name},#{sex},#{age})")
    void addOneDao(Student student);

    @Delete("delete from student where id=#{id}")
    void deleteDataDao(Integer id);

    @Select("select * from student where id=#{id}")
    Student selectOneDao(Integer id);

    @Update("update student set name=#{name},sex=#{sex},age=#{age} where id=#{id}")
    void updateDao(Student student);

    @Select("select * from manager where admin=#{admin} and password=#{password}")
    Manager isAdminDao(Manager manager);
}
